function [norm_mat] = get_normalization_matrix(x)
centroid = mean(x,1);
dists = sqrt(sum((x - repmat(centroid,size(x,1),1)).^2,2));
mean_dist = mean(dists);
norm_mat = [sqrt(2)/mean_dist,0,-sqrt(2)/mean_dist*centroid(1);...
            0,sqrt(2)/mean_dist,-sqrt(2)/mean_dist*centroid(2);...
            0,0,1];
end
